package com.to_door_recycle.common.exception;

import com.to_door_recycle.common.enums.ExceptionStatusEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

@Getter
public class BaseException extends RuntimeException{
    private Integer code;
    private String message;

    public BaseException(Integer code,String message) {
        super(message);
        this.code = code;
        this.message = message;
    }
    public BaseException(ExceptionStatusEnum statusEnum) {
        super(statusEnum.getMessage());
        this.code = statusEnum.getCode();
        this.message = statusEnum.getMessage();
    }

}
